package org.domain.sigepac.Entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;

@MappedSuperclass
public abstract class DestinoAbstract extends EntidadeAbstrata {


	private static final long serialVersionUID = 2624449853716240343L;


	@EmbeddedId
	private DestinoId id=new DestinoId();

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_aluno", insertable = false, updatable = false)
	private Aluno aluno;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_turma", insertable = false, updatable = false)
	private Turma turma;



	@Column(name="comentarios",nullable=true,length=500)
	@Length(max=500)
	private String comentarios;

	@Column(name="data",nullable=false)
	@Temporal(TemporalType.DATE)
	private Date data;

	public Serializable getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public void setId(DestinoId id) {
		this.id = id;
	}
	public Aluno getAluno() {
		return aluno;
	}


	public String getComentarios() {
		return comentarios;
	}
	public void setComentarios(String comentarios) {
		this.comentarios = comentarios;
	}

	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
		//((EvasaoId)getId()).setIdAluno((Integer)aluno.getId());
	}

	public Turma getTurma() {
		return turma;
	}


	public void setTurma(Turma turma) {
		this.turma = turma;
		//((EvasaoId)getId()).setIdTurma((Integer)turma.getId());
	}

	public Date getData() {
		return data;
	}
	public void setData(Date data) {
		this.data = data;
	}

}
